Conventionally, when transferring video data between television broadcasting stations, or when copying video data using a plurality of video recorders (VTR devices), the video data encoded in MPEG (Moving picture experts group) format are decoded and then encoded again. Therefore, an encoder and a decoder need to be connected in series and in tandem.
And a so-called “back search” method is employed to reduce the deterioration of the quality of video caused by the repetition of encoding and decoding in the case of tandem connection.
Here, “back search” is a method to obtain a quantization step regarding a minimum value as an appropriate quantization step by using the characteristic that the sum of residues of Discrete Cosine Transfer (DCT) coefficient becomes the smallest when a quantization step used in the previous encoding process or a quantization step that is a multiple of the one used in the previous encoding process is used.
For example, as for the technique that uses “back search,” a video data compression device is disclosed in Patent Document 1. The video data compression device prevents the deterioration of the quality of video caused by the repetition of encoding and decoding when an encoder and a decoder are connected in tandem: this device reproduces the quantization step of the previous encoding process in back search method, and uses the same quantization step and GOP (Group of pictures) phase as the previous process to encode an input video data.
On the other hand, these days, instead of MPEG format, AVC (Advanced Video Coding) standard is widely used, ranging from a low speed and low video quality usage, like a television phone of a cell phone, to a large capacity and high video quality moving pictures, like high definition television broadcasting. However, this uses a combination of algorithms, including motion compensation, inter frame prediction, DCT, and entropy encoding. This means that the standard has been revamped so that this requires about half the amount of data if the quality is the same as MPEG.
In the intra image encoding of AVC, in order to improve the efficiency of encoding, an intra image prediction method that predicts the value of a pixel in a macro block from surrounding pixels inside an image and encodes difference image data generated from the prediction was introduced. An AVC stream encoded by using only this intra image encoding method is referred to as AVC Intra, hereinafter. That is, in the case of AVC Intra, the input image is divided, during the encoding process, into a prediction image generated from the surrounding pixels and a difference, and then the difference is encoded.
Nine modes, including prediction from the upper pixels and prediction from the horizontal pixels, are prepared for the prediction image; a prediction mode is usually employed so that the sum of differences from the prediction image on a unit block basis (for example, 4×4 sample or the like) becomes the smallest.
Patent Document 1: Japanese Patent Publication No. H10-174098
However, according to the above-noted conventional method, the amount of generated codes during the encoding process are likely to decrease, but since the encoding process of AVC for the quantization portion is irreversible transformation, the quality of video drops as the encoding and decoding processes are repeated, because quantization distortion occurs on the original input image after the encoding and decoding processes. Especially if a different prediction mode from the one used in the previous encoding process is employed, quantization distortion occurs again due to the effect of the previous quantization distortion, which might eventually cause a problem that the quality of video decreases.